Skip to content

ensure that a chromium process started by Quarto is always closed#11195

Merged
cderv merged 1 commit into
mainfrom
fix/chrome-cleaning
Oct 25, 2024
Merged

ensure that a chromium process started by Quarto is always closed#11195
cderv merged 1 commit into
mainfrom
fix/chrome-cleaning

Conversation

@cderv

@cderv cderv commented Oct 25, 2024

Copy link
Copy Markdown
Member

Follow up on #11135 and #11187 as they surfaced a problem where Chromium processed where not closed after rendering.

The real issue is there

close: async () => {
await client.close();

where somehow await client.close() does not return and so browser.close() never happens. This was confirmed by debugging interactively in VSCODE on Windows.

This PR is not solving the issue which is tracked at #11196 - it is only improving current logic for 1.6 releases to make sure we do clean after ourselves in all cases, like we do with other processed.

So for that aim, this PR adds browser Deno process to the same cleanupHandler for processes for quarto exitWithCleanup() logic. This cleanupHandler has all processes started with execProcess() already, but we can't use execProcess() here as we want to start the process in background, do HTML printing, then close.

…exitWithCleanup logic

As of 2024-10 and chrome v130, there is a problem where Chrome client `close()` function won't return correctly, skipping the normal code part of closing a chromium process started. So processes were not killed. Now those browser processes are added to the same cleanup handler used by `execProcess()` logic so that in case of something going wrong, they are killed and closed at last resort when Quarto exists.

@cscheid cscheid left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@cderv cderv merged commit d905295 into main Oct 25, 2024
@cderv cderv deleted the fix/chrome-cleaning branch October 25, 2024 18:50
@cderv cderv added this to the v1.6 milestone Oct 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants